<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('添加小说')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-novel-add">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">选择图书：</label>
                    <div class="col-sm-8">
                        <select name="novelId" id="novelId" class="form-control" required>
                            <!-- 商品选项将通过 JavaScript 动态填充 -->
                            <option th:each="novel:${novels}" th:value="${novel.novelId}" th:text="${novel.title}"></option>
                        </select>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/novel"
        $("#form-novel-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-novel-add').serialize());
            }
        }
    </script>
</body>
</html>